package com.buy.service.Impl;

import com.buy.FruitConstants;
import com.buy.service.BuyingProblem;
import com.buy.utile.ComputeUtil;

import java.util.Scanner;

public class BuyingProblemFour implements BuyingProblem {

    @Override
    public  void problem(){
        Integer result = 0;

        Scanner scanner = new Scanner(System.in); // 创建Scanner对象
        result = result + ComputeUtil.computeFruit(scanner,"苹果", FruitConstants.APPLE_PER,100);
        result = result +ComputeUtil.computeFruit(scanner,"草莓",FruitConstants.STRAWBERRIES_PER,80);
        result = result +ComputeUtil.computeFruit(scanner,"芒果",FruitConstants.MANGO_PER,100);
        Integer maxOut = result/100;
        result = result -(maxOut*10);

        System.out.println("需要支付购买的水果金额为"+result+"元");
    }
}
